<?php
class eBoxMenuCateForm extends Form
{
    function __construct()
    {
        Form::Form('eBoxMenuCateForm');
    }

    function draw()
    {
        global $display;
        $display->add('is_admin', User::have_permit(ADMIN_NEWS));

        $total = (int)DB::fetch('SELECT count(*) as total FROM ' . _SESS_TABLE . ' WHERE session_expires >' . (TIME_NOW - 900), 'total', 1);
        $mem   = (int)DB::fetch('SELECT count(total) as total FROM ( SELECT count(user_id) as total FROM ' . _SESS_TABLE . ' WHERE session_expires >' . (TIME_NOW - 900) . ' AND user_id !=0 GROUP BY user_id) as t', 'total', 1);
        $guest = (int)($total - $mem);
        $display->add("online", number_format($total, NULL, NULL, '.'));
        $display->add("mem", number_format($mem, NULL, NULL, '.'));
        $display->add("guest", number_format($guest, NULL, NULL, '.'));

        $display->add("site_hit", (int)User::$site_hit);
        $display->add("site_hit_day", (int)User::$site_hit_day);
        $display->output('eBoxMenuCateForm');

    }
}

?>